home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 127 / dpcs0998.iso / Internet / netobs / Install.exe / t2.z / BREAKOUT.DCR / 00007_misc. scripts.ls < prev    next >
Encoding:
Text File  |  1998-01-20  |  3.4 KB  |  112 lines

  1. on pongPaddleMove
  2.   global giPongPaddleChannel, giPaddleHalfWidth
  3.   set the locH of sprite giPongPaddleChannel to the mouseH - giPaddleHalfWidth
  4. end
  5.  
  6. on soundPaddleHit
  7.   puppetSound("PaddlePoing")
  8. end
  9.  
  10. on updateScore piLevel
  11.   global giPongScore, glPingSounds, glBrickList
  12.   set the text of cast "PongScore" to string(giPongScore)
  13.   if integerp(piLevel) then
  14.     set lsSoundName to getAt(glPingSounds, piLevel)
  15.     puppetSound(lsSoundName)
  16.   end if
  17.   if max(max(glBrickList)) = 0 then
  18.     pongNewLevel()
  19.   end if
  20. end
  21.  
  22. on pongNewLevel
  23.   global giPongLevel, giPongPaddleChannel, giPlayFieldBottomBoundary, glBulletsInPlay, gbDuck, giPongBall
  24.   set giPongLevel to giPongLevel + 1
  25.   if giPongLevel > 1 then
  26.     waitForTicks(30)
  27.     pongBonus(giPongLevel)
  28.   end if
  29.   set the text of field "PongLevel" to string(giPongLevel)
  30.   updateStage()
  31.   repeat with counter = 1 to count(glBallsInPlay)
  32.     mPongBallReset(getAt(glBallsInPlay, counter))
  33.   end repeat
  34.   repeat with counter = 1 to count(glBulletsInPlay)
  35.     mPongBulletReset(getAt(glBulletsInPlay, counter))
  36.   end repeat
  37.   set liPaddleSize to 9 - integer((giPongLevel / 2) + 0.5)
  38.   if liPaddleSize < 1 then
  39.     set liPaddleSize to 1
  40.   end if
  41.   set liPaddleLevel to integer((giPongLevel / 3) + 0.5)
  42.   if liPaddleLevel > 9 then
  43.     set liPaddleLevel to 9
  44.   end if
  45.   set lsBrickType to "pongBrick"
  46.   set gbDuck to 0
  47.   set liRows to integer(giPongLevel mod 10 / 2)
  48.   set liTopOffset to 0
  49.   if liRows < 2 then
  50.     set liRows to liRows + random(3)
  51.   end if
  52.   set liColumns to (giPongLevel mod 16) + 8
  53.   put "liRows      = " & liRows
  54.   put "liColumns   = " & liColumns
  55.   put "liTopOffset = " & liTopOffset
  56.   pongBuildWall(lsBrickType, liRows, liColumns, liTopOffset)
  57.   pongInitBrickList(liRows, liColumns)
  58.   pongPaddleChange(liPaddleSize)
  59.   pongPaddleLevel(liPaddleLevel)
  60.   set the text of cast "PongBall" to string(giPongBall - 1)
  61. end
  62.  
  63. on pongNewBall
  64.   global giPongBall, giPongSplashChannel, giHideOffset
  65.   if giPongBall > 1 then
  66.     set giPongBall to giPongBall - 1
  67.     set the text of field "PongBall" to string(giPongBall - 1)
  68.     updateStage()
  69.   else
  70.     pongGameOver()
  71.   end if
  72.   set the locH of sprite giPongSplashChannel to giHideOffset
  73. end
  74.  
  75. on pongPaddleLevel piLevelNum
  76.   global giPongPaddleChannel, giPlayFieldBottomBoundary
  77.   set the locV of sprite giPongPaddleChannel to giPlayFieldBottomBoundary - ((14 * piLevelNum) + 10)
  78.   debugMessage("pongPaddleLevel completed w/ piLevelNum = " & piLevelNum)
  79. end
  80.  
  81. on pongGameOver
  82.   global gbPaused
  83.   go("GameOver")
  84.   set gbPaused to 1
  85. end
  86.  
  87. on pongBonus pongLevel
  88.   global giBonusChannel, giPongScore
  89.   set pongLevel to pongLevel - 1
  90.   set bonusMultiplier to 5 * pongLevel
  91.   set pongBonus to pongLevel * 10 * bonusMultiplier
  92.   set the text of cast "bonus" to "Level" && pongLevel && "Bonus =" && pongBonus
  93.   set the visible of sprite giBonusChannel to 1
  94.   set the locH of sprite giBonusChannel to 130
  95.   puppetSound("clickOne")
  96.   updateStage()
  97.   waitForTicks(100)
  98.   repeat with i = 1 to pongLevel * bonusMultiplier
  99.     set the text of cast "bonus" to "Level" && pongLevel && "Bonus =" && string(pongBonus - (i * 10))
  100.     set the text of cast "pongScore" to string(value(the text of cast "pongScore") + 10)
  101.     puppetSound("clickOne")
  102.     updateStage()
  103.     waitForTicks(5)
  104.   end repeat
  105.   waitForTicks(45)
  106.   set the visible of sprite giBonusChannel to 0
  107.   set the locH of sprite giBonusChannel to 1000
  108.   puppetSound("clickOne")
  109.   updateStage()
  110.   set giPongScore to giPongScore + pongBonus
  111. end
  112.